﻿using System.Windows.Forms;

namespace ThreadSafeControls {
    public class ThreadSafeProgressBar : ThreadSafeControl<ProgressBar> {

        public ThreadSafeProgressBar(ProgressBar progressBar) : base(progressBar) { }

        public int MarqueeAnimationSpeed {
            get { return ReturnAsync(c => c.MarqueeAnimationSpeed); }
            set { UpdateAsync(c => c.MarqueeAnimationSpeed = value); }
        }

        public int Maximum {
            get { return ReturnAsync(c => c.Maximum); }
            set { UpdateAsync(c => c.Maximum = value); }
        }

        public int Minimum {
            get { return ReturnAsync(c => c.Minimum); }
            set { UpdateAsync(c => c.Minimum = value); }
        }

        public int Step {
            get { return ReturnAsync(c => c.Step); }
            set { UpdateAsync(c => c.Step = value); }
        }

        public ProgressBarStyle Style {
            get { return ReturnAsync(c => c.Style); }
            set { UpdateAsync(c => c.Style = value); }
        }

        public int Value {
            get { return ReturnAsync(c => c.Value); }
            set { UpdateAsync(c => c.Value = value); }
        }

        public void Increment(int value) {
            UpdateAsync(c => c.Increment(value));
        }

    }
}
